import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import i18n from './lang/i18n'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';


// 引入进度条样式
import 'nprogress/nprogress.css'

//引入自定义滚动条
import HappyScroll from 'vue-happy-scroll'
import 'vue-happy-scroll/docs/happy-scroll.css'
import VueCropper from 'vue-cropper';
//自动滚动插件
import scroll from 'vue-seamless-scroll'
import VueClipBoard from 'vue-clipboard2'


// 炫酷的粒子动效
import  VueParticles  from   'vue-particles'

// 引入图表
import VCharts from 'v-charts'

Vue.use(VCharts)

// 制作地图
import echarts from 'echarts'
Vue.prototype.$echarts = echarts
import china from 'echarts/map/json/china.json'
echarts.registerMap('china', china)





Vue.config.productionTip = false
Vue.use(VueCropper)
Vue.use(HappyScroll)
Vue.use(VueClipBoard);
Vue.use(scroll)

Vue.use(VueParticles)

Vue.use(ElementUI);

// 全局路由守卫
import './router/permission'

// 全局注册指令
import vPermission from './directive/permission'
Vue.directive('permission',vPermission) 
// parent.sid='c8636555-46ce-4084-889a-42d9d9f22a12'
window.sid =parent.sid;
Vue.prototype.$sid=window.sid;
import Router from 'vue-router'

// 这个是为了避免一个报错
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app')
